package leetcode.acm;

import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * @author mazouri
 * @create 2021-09-26 19:44
 */
public class Fibonacci {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] dp = new int[2];
        dp[0] = 0;
        dp[1] = 1;

        for (int i = 2; i <= n; i++) {
            int sum = (dp[0] + dp[1]) % 10007;
            dp[0] = dp[1];
            dp[1] = sum;
        }

        System.out.println(dp[1]);
    }
}
